﻿@page "/datagrid/selection-api"

@using Syncfusion.Blazor.Grids
@using Syncfusion.Blazor.Inputs
@using Syncfusion.Blazor.Buttons

@*Hidden:Lines*@
@using BlazorDemos
@using blazor_inventordata

@*End:Hidden*@

<div class="col-lg-12 control-section">
    <div class="content-wrapper">
        <div class="row">
            <SfGrid DataSource="@GridData" AllowSelection="true" AllowPaging="true">
                <GridSelectionSettings Type="Syncfusion.Blazor.Grids.SelectionType.Multiple"></GridSelectionSettings>
                <GridPageSettings PageCount="2"></GridPageSettings>
                <GridColumns>
                    <GridColumn Field=@nameof(InventorDetails.Inventor) HeaderText="Inventor Name" IsPrimaryKey="true" Width="140"></GridColumn>
                    <GridColumn Field=@nameof(InventorDetails.NumberofPatentFamilies) HeaderText="No of Patent Families" Width="185" TextAlign="TextAlign.Right" ></GridColumn>
                    <GridColumn Field=@nameof(InventorDetails.Country) HeaderText="Country" Width="120"></GridColumn>
                    <GridColumn Field=@nameof(InventorDetails.Active) HeaderText="Active" Width="130"></GridColumn>
                </GridColumns>
            </SfGrid>
        </div>
    </div>
</div>

@*<div class="col-lg-3 property-section">
    <h4 style="margin-top:38px;">Properties</h4>

    <table id="property" style="width: 73%; height: 300px;">
        <tr>
            <td class="left-side" style="padding-right:15px;"><b>Select Rows</b></td>
        </tr>
        <tr>
            <td class="left-side" style="padding-right:15px;">Start</td>
            <td>
                <SfNumericTextBox id="start" min="1" width="100"></SfNumericTextBox>
            </td>
        </tr>
        <tr>
            <td class="left-side" style="padding-right:15px;">To</td>
            <td>
                <SfNumericTextBox id="to" min="1" width="100"></SfNumericTextBox>
            </td>
        </tr>
        <tr>
            <td class="left-side" style="padding-right:15px;"><b>Select Row</b></td>
            <td>
                <SfButton id="select" IsPrimary="true">Select Row</SfButton>
            </td>
        </tr>
        <tr>
            <td class="left-side" style="padding-right:15px;"><b>Clear Selection</b></td>
            <td>
                <SfButton id="clear" IsPrimary="true">Clear Selection</SfButton>
            </td>
        </tr>
    </table>
</div>*@

@code{

    public List<InventorDetails> GridData { get; set; }

    protected override void OnInitialized()
    {
        GridData = InventorDetails.GetAllRecords();
    }
}
